import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AppComponent } from './app.component';
import { AdminAuthGuard } from './shared/guard/admin-auth.guard';
import { AgentAuthGuard } from './shared';
import { CustomerAuthGuard } from './shared/guard/customer-auth.guard';


const routes: Routes = [
    { path: '', redirectTo: 'home', pathMatch: 'full'},
    { path: 'home', loadChildren: './home/home.module#HomeModule'},
    { path: 'admin', loadChildren: './layout/layout.module#LayoutModule', canActivate: [AdminAuthGuard] },
    { path: 'login', loadChildren: './login/login.module#LoginModule' },
    { path: 'agent', loadChildren: './agent/agent.module#AgentModule',canActivate: [AgentAuthGuard] },
    { path: 'shared', loadChildren: './shared-property-resource/shared.module#SharedResourceModule'},
    { path: 'customer', loadChildren: './customer/customer.module#CustomerModule',canActivate: [CustomerAuthGuard] },
    { path: 'signup', loadChildren: './signup/signup.module#SignupModule' },
    { path: 'access-denied', loadChildren: './access-denied/access-denied.module#AccessDeniedModule' },
    { path: 'not-found', loadChildren: './not-found/not-found.module#NotFoundModule' },
    { path: '**', redirectTo: 'not-found' }
];

@NgModule({
    imports: [RouterModule.forRoot(routes)],
    // imports: [RouterModule.forRoot(routes,{ enableTracing: true })],
    exports: [RouterModule]
})
export class AppRoutingModule {}
